package com.lzx.adx.report.support;

import com.lzs.adx.commmon.utils.SpringContextUtils;
import com.lzx.adx.report.enums.base.MediaChannel;
import com.lzx.adx.report.support.strategy.media.*;

public class CallBackFactory {


    /**
     * 媒体
     * @param mediaChannel
     * @return
     */
    public static AbstractCallback getCallBack(String mediaChannel){
        if(mediaChannel.equals(MediaChannel.BEI_ZI.getMediaChannel())){
            return SpringContextUtils.getBean(BeiZiCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.WIFI.getMediaChannel())){
            return SpringContextUtils.getBean(WifiCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.KS.getMediaChannel())){
            return SpringContextUtils.getBean(KsCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.XIAO_MI.getMediaChannel())){
            return SpringContextUtils.getBean(XiaoMiCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.SFKJ.getMediaChannel())){
            return SpringContextUtils.getBean(SfkjCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.YOYO.getMediaChannel())){
            return SpringContextUtils.getBean(YoYoCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.BAIDU.getMediaChannel())){
            return SpringContextUtils.getBean(BaiduCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.HW.getMediaChannel())){
            return SpringContextUtils.getBean(HwCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.KSDR.getMediaChannel())){
            return SpringContextUtils.getBean(KsDrCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.OPPO.getMediaChannel())){
            return SpringContextUtils.getBean(OppoCallBackStrategy.class);
        }
        if(mediaChannel.equals(MediaChannel.XMLY.getMediaChannel())){
            return SpringContextUtils.getBean(XmlyCallBackStrategy.class);
        }
        if (mediaChannel.equals(MediaChannel.GDT.getMediaChannel())){
            return SpringContextUtils.getBean(GdtCallBackStrategy.class);
        }

        return null;
    }
}
